class CreateProducts < ActiveRecord::Migration
  def self.up
    create_table :products do |t|
      t.column "name", :string
      t.column "description", :text
      t.column "url", :string
      t.column "image", :string
      t.column "price", :integer
      t.timestamps
    end
    
    create_table :posts_products do |t|
      t.column "post_id", :integer
      t.column "product_id", :integer
    end
  end

  def self.down
    drop_table :products
    drop_table :posts_products
  end
end
